package cn.tedu.test.luban.starter.config;

import cn.tedu.test.luban.starter.bean.Bean03;
import cn.tedu.test.luban.starter.condition.OSCondition;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
//当前配置类是否加载 取决于条件计算返回结果了 写死了条件false不满足
@Conditional(OSCondition.class)
public class MyConfiguration02 {
    public MyConfiguration02() {
        System.out.println("当前myConfiguration02被容器加载");
    }
    @Bean

    public Bean03 bean03(){
        return new Bean03();
    }
}
